//
//  PictureScrollView.m
//  UI_Homework_Day6_02
//
//  Created by 黄威 on 16/5/10.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "PictureScrollView.h"

@implementation PictureScrollView

- (instancetype)initWithFrame:(CGRect)frame{


    [super initWithFrame:frame];
    
    
    if (self) {
        [self config];
    }


    return self;

}

- (void)config{


    self.showsVerticalScrollIndicator = YES;
    self.pagingEnabled = YES;
    self.minimumZoomScale = 0.5;
    self.maximumZoomScale = 3;

}



- (void)addpicture:(NSArray<UIImage *> * )picture{


    self.contentSize =CGSizeMake(CGRectGetWidth(self.bounds) * picture.count, CGRectGetHeight(self.bounds));
    for (NSInteger i = 0; i < picture.count; i++) {
        
        UIImageView *uiimageview = [[UIImageView alloc]initWithImage:picture[i]];
        
        
        
        uiimageview.frame = CGRectMake(CGRectGetWidth(self.bounds) * i, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds));
        
        [self addSubview:uiimageview];
        
        [uiimageview release];
    }

    

}

@end
